using System;
using System.Collections;
using System.Collections.Generic;
namespace Core
{
    public class BulletComponent : Entity
    {
        public Bullet CreateBullet(Unit caster, int bulletId)
        {
            var config = World.GetComponent<ConfigComponent>().GetConfig<BulletConfig>(bulletId);
            if (config == null)
                return default;

            var bullet = AddChild<Bullet, BulletConfig, Unit>(config, caster);
            World.Main.EventSystem.RegisterSystem(bullet);
            return bullet;
        }
    }
}